package de.baumann.browser.fragments.duobao

import android.view.View
import de.baumann.browser.activitys.duobao.DuoBaoDetailActivity
import de.baumann.browser.adapter.DuoBaoAdapter
import kotlinx.android.synthetic.main.fragment_order.*

class OrderJinXingFragment : OrderFragment() {

    companion object {
        val instance: OrderJinXingFragment by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
            OrderJinXingFragment()
        }
    }

    override fun initView(view: View) {
        duoBaoAdapter = DuoBaoAdapter(null)
        duobaoOrderList.adapter = duoBaoAdapter
        duoBaoAdapter.setOnItemClickListener { _, _, position ->
            val duobao = duoBaoAdapter.getItem(position)
            DuoBaoDetailActivity.startDuoBaoDetailActivity(mContext, duobao!!.activityId, duobao.phaseNum)
        }
    }

    override fun initData() {
        getPresenter().process()
    }

}